#include <netinet/in.h>
#include "type.h"

typedef struct{
    uint8 version;
    uint8 reserved;
    uint8 rmcp_seq;
    uint8 class_of_message;
} __attribute__((__packed__)) rmcp_header_t;

typedef struct{
    uint8 auth_type;
    uint8 payload_type;
    uint8 oem_iana[4];
    uint16 oem_payload_id;
    uint32 ipmi_session_id;
    uint32 session_seq_no;
    uint16 ipmi_payload_len;
} __attribute__((__packed__)) ipmi_session_header_2_0_t;

typedef struct{
    uint8 auth_type;
    uint32 session_seq_no;
    uint32 ipmi_session_id;
    uint8 ipmi_payload_len;
} __attribute__((__packed__)) ipmi_session_header_1_5_t;

typedef struct{
    uint8 dstAddr;
    uint8 netFn;
    uint8 checksum1;
    uint8 srcAddr;
    uint8 srcSeq;
    uint8 cmd;
} __attribute__((__packed__)) ipmi_lan_message_format_t;

typedef struct{
    rmcp_header_t rmcp_header;
    ipmi_session_header_1_5_t ipmi_header;
    ipmi_lan_message_format_t ipmi_message;
} __attribute__((__packed__)) ipmi_lan_1_5_t;

typedef struct{
    rmcp_header_t rmcp_header;
    ipmi_session_header_2_0_t ipmi_header;
    ipmi_lan_message_format_t ipmi_message;
} __attribute__((__packed__)) ipmi_lan_2_0_t;

